<div class="content">
    <div class="grid_container">

        <div class="grid_12" style="background-color: <?php echo $color ?>">
            <div class="widget_wrap">
                <div class="widget_top">
                    <span class="h_icon list"></span>
                    <h6>Ficha consulta Nro-<?php echo $ficha['Consultasexterna']['id'] ?></h6>
                </div>
<div class="content">
    <div class="grid_container">
    
    <div class="grid_12">
            <div class="widget_wrap">
                <div class="widget_top">
                    <span class="h_icon blocks_images"></span>
                    <h6>Antecedentes</h6>
                </div>
                <div class="widget_content">
                    <h3>Listado Antecedentes </h3>
                    <table class="display data_tbl">
                        <thead>
                            <tr>
                                <th class="sorting_desc">
                                    Nro.
                                </th>
                                <th>
                                    Nro. de Consulta
                                </th>
                                <th>
                                    Paciente
                                </th>
                                <th>
                                    Fecha 
                                </th>
                                <th>
                                    Motivo de Consulta
                                </th>
                                <th>
                                    Diagnostico
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php $i=1;?>
                            <?php foreach ($historial as $h): ?>
                                <tr class="<?php echo fmod($i, 2) ? "gradeA" : "gradeC" ?>">
                                    <td><?php echo $i; $i++;?></td>
                                    <td class=" sorting_1">
                                        <?php echo $h['Consultasexterna']['id'] ?>
                                    </td>
                                    <td>
                                        <?php echo $h['Paciente']['nombres'].''.$h['Paciente']['ap_paterno'].''.$h['Paciente']['ap_materno'] ?>
                                    </td>
                                    <td>
                                        <?php echo $h['Consultasexterna']['fecha'] ?>
                                    </td>
                                    <td class="center">
                                        <?php echo $h['Consultasexterna']['motivoconsulta'] ?>
                                    </td>
                                    <td class="center">
                                        <?php echo $h['Consultasexterna']['diagnostico'] ?>
                                    </td>
                                </tr>
                            <?php endforeach; ?>
                        </tbody>
                    </table>
                   
                </div>
            </div>
                <div class="grid_12">
            <div class="widget_wrap">
                <div class="widget_top">
                    <span class="h_icon blocks_images"></span>
                    <h6>Antecedente al&eacute;rgicos</h6>
                </div>
                <div class="widget_content">
                    
                    <table class="display data_tbl">
                        <thead>
                            <tr>
                                <th>
                                    Nro.
                                </th>
                                <th>
                                    Paciente
                                </th>
                                <th>
                                    Antecedente al&eacute;rgico
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php $i=1; ?>
                            <?php foreach ($historialergias as $h): ?>
                                <tr class="<?php echo fmod($i, 2) ? "gradeX odd" : "gradeX even" ?>">
                                    <td><?php echo $i; $i++;?></td>
                                    <td><?php echo $h['Paciente']['nombres'].''.$h['Paciente']['ap_paterno'].''.$h['Paciente']['ap_materno'] ?></td>
                                    <td>
                                        <?php echo $h['Ciede']['cod4'] ?>&nbsp;
                                        <?php echo $h['Ciede']['descod4']?>&nbsp;
                                        <?php echo $h['CiedesPaciente']['observaciones']?>
                                    </td>
                                </tr>
                            <?php endforeach; ?>
                        </tbody>
                    </table>
                   
                </div>
            </div>
        </div>
      
    </div>
</div>
</div>
</div>
</div>
</div> 
</div>